package uds.android.fitdroid.ui.tabs;

import java.util.Stack;

import android.util.Log;
import android.widget.TabHost;

public class TabTracker {

	private TabHost tabHost = null;

	private static TabTracker tabTracker = null;

	private Stack<Object> tabStack = null;

	private TabTracker() {
		tabStack = new Stack<Object>();
		tabStack.empty();
	}
	
	public boolean isEmpty(){
		return this.tabStack.isEmpty();
	}

	public void push(Object obj) {
		Log.i("tracker", "push to: " + this.tabStack.size());
		this.tabStack.push(obj);
	}

	public Object pop() {
		if (this.tabStack.isEmpty())
			return null;
		else{
			Object temp = this.tabStack.pop();
			Log.i("tracker", "pop to: " + this.tabStack.size());
			return temp;
		}
	}

	public static TabTracker getInstance() {
		if (tabTracker == null) {
			tabTracker = new TabTracker();
		}
		return tabTracker;
	}

	public void setTabHost(TabHost tabHost) {
		this.tabHost = tabHost;
	}

	public TabHost getTabHost() {
		return tabHost;
	}
}
